import axios from "axios";


function getApi(url) {
    return axios({ 
        method: "get",
        url,
        headers: {
            "token":sessionStorage.getItem("token")
        }
    });
}

function postApi(url, data) {
    return axios({
        method: "post",
        url,
        headers: {
            "token":sessionStorage.getItem("token")
        },
        data,
    });
}

function deleteApi(url) {
    return axios({
        method: "delete",
        url,
        headers: {
            "token":sessionStorage.getItem("token")
        }
    });
}

function updateApi(url,data,params) {
    return axios({
        method: "put",
        url,
        headers: {
            "token":sessionStorage.getItem("token")
        },
        data,
        params,
    });
}
export { getApi, postApi, deleteApi, updateApi };